<!DOCTYPE html>
<html >
<head>
    <meta charset="UTF-8">
    <title>主生产计划</title>
    <script type="text/javascript">
    $(function () {
       $.get("/scgl_wzxqjhselectOne?scglWzxqjhDocumentnum="+xinxi,null,
       function (data) {
           var html=" <!--               第一行-->\n" +
               "                <tr>\n" +
               "                    <td colspan=\"6\">基本信息</td>\n" +
               "                </tr>";
           html+=" <!--                第二行-->\n" +
              "                <tr>\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td\">单据编号</td>\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td01\">\n" +
              "                        <input  type=\"text\" readonly=\"readonly\" id=\"scgl_scjhmx_documentNum\" name=\"scgl_scjhmx_documentNum\" value=\""+data.scglWzxqjhDocumentnum+"\"/>\n" +
              "                    </td>\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td\">主题</td>\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td01\">\n" +
              "                        <input  type=\"text\" readonly=\"readonly\" id=\"scgl_scjhmx_subject\" name=\"scgl_scjhmx_subject\" value=\""+data.scglWzxqjhSubject+"\" />\n" +
              "                    </td>\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td\">负责人</td>\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td01\">\n" +
              "                        <input  type=\"text\" readonly=\"readonly\" id=\"scgl_scjhmx_personInCharge\" name=\"scgl_scjhmx_personInCharge\" value=\""+data.scglWzxqjhPersonincharge+"\"/>\n" +
              "                    </td>\n" +
              "                </tr>\n" +
              "                <!--               第三行-->\n" +
              "                <tr >\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td\">部门</td>\n" +
              "                    <td colspan=\"5\" class=\"scgl_scjhmx_firsttable_tr_td01\">\n" +
              "                        <input  type=\"text\" readonly=\"readonly\"  id=\"scgl_scjhmx_department\" name=\"scgl_scjhmx_department\" value=\""+data.scglWzxqjhDepartment+"\"/>\n" +
              "                    </td>\n" +
              "                </tr>\n" +
              "                <!--              第四行-->\n" +
              "                <tr >\n" +
              "                    <td class=\"scgl_scjhmx_firsttable_tr_td\">主生产计划</td>\n" +
              "                    <td colspan=\"5\" class=\"scgl_scjhmx_firsttable_tr_td01\">\n" +
              "                        <input  type=\"text\" readonly=\"readonly\" id=\"scgl_scjhmx_project\"  name=\"scgl_scjhmx_project\" value=\""+data.scglWzxqjhMppId+"\"/>\n" +
              "                    </td>\n" +
              "                </tr>";
                    $("#scgl_scjhmx_firsttable").append(html);

            var html01=" <!--               第一行-->\n" +
                "                <tr><td colspan=\"6\">合计信息</td></tr>\n" +
                "                <!--                第二行-->\n" +
                "                <tr>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td\">生产计划数量合计</td>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\" colspan=\"5\">\n" +
                "                        <input  type=\"text\" readonly=\"readonly\" id=\"scgl_scjhmx_allProductionNum\"  name=\"scgl_scjhmx_allProductionNum\" value=\""+data.scglWzxqjhAllProductionNum+"\" />\n" +
                "                    </td>\n" +
                "                </tr>";
            html01+="<tr><td colspan=\"6\">备注信息</td></tr>";
            html01+="<tr>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td\">单据状态</td>";

            if(data.scglWzxqjhBillsstatus==1){
                var tishiXinxi="未执行"
                html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                    "                        <input  type=\"text\" id=\"scgl_scjhmx_billsStatus\"  name=\"scgl_scjhmx_billsStatus\" value=\""+tishiXinxi+"\"/>\n" +
                    "                    </td>";
            }
           if(data.scglWzxqjhBillsstatus==2){
               var tishiXinxi="正在执行"
               html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_billsStatus\"  name=\"scgl_scjhmx_billsStatus\" value=\""+tishiXinxi+"\"/>\n" +
                   "                    </td>";
           }
           if(data.scglWzxqjhBillsstatus==3){
               var tishiXinxi="以执行"
               html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_billsStatus\"  name=\"scgl_scjhmx_billsStatus\" value=\""+tishiXinxi+"\"/>\n" +
                   "                    </td>";
           }
           html01+="<td class=\"scgl_scjhmx_secondtable_tr_td\">制单人</td>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                "                        <input  type=\"text\" readonly=\"readonly\" id=\"scgl_scjhmx_singlePlayer\" name=\"scgl_scjhmx_singlePlayer\" value=\""+data.scglWzxqjhSingleplayer+"\"/>\n" +
                "                    </td>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td\">制单日期</td>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                "                        <input type=\"text\" readonly=\"readonly\" name=\"scgl_scjhmx_documentDate\" id=\"scgl_scjhmx_documentDate\" value=\""+data.scglWzxqjhDocumentdate+"\"/>\n" +
                "                    </td>\n" +
                "                </tr>";
           <!--              第五行-->
           html01+="<tr><td class=\"scgl_scjhmx_secondtable_tr_td\">确认人</td>";
          if(data.scglWzxqjhConfirmpeople==null||data.scglWzxqjhConfirmpeople==""){

              html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                  "                        <input  type=\"text\" id=\"scgl_scjhmx_confirmPeople\"  name=\"scgl_scjhmx_confirmPeople\"/>\n" +
                  "                    </td>";
          }
           if(!data.scglWzxqjhConfirmpeople==""){
               html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_confirmPeople\"  name=\"scgl_scjhmx_confirmPeople\" value=\""+data.scglWzxqjhConfirmpeople+"\"/>\n" +
                   "                    </td>";
           }

           html01+=  "<td class=\"scgl_scjhmx_secondtable_tr_td\">确认日期</td>";

           if(data.scglWzxqjhConfirmdate==null||data.scglWzxqjhConfirmdate==""){
               html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "          <input class=\"layui-input\"  type=\"text\" id=\"scgl_scjhmx_confirmDate\"  name=\"scgl_scjhmx_confirmDate\" />\n" +
                   "                    </td>";
           }
           if(!data.scglWzxqjhConfirmdate==""){
               html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_confirmDate\"  name=\"scgl_scjhmx_confirmDate\" value=\""+data.scglWzxqjhConfirmdate+"\"/>\n" +
                   "                    </td>";
           }
           html01+="<td class=\"scgl_scjhmx_secondtable_tr_td\">结单人</td>";
           if(data.scglWzxqjhStatementpeople==null||data.scglWzxqjhStatementpeople==""){
               html01+="<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_statementPeople\" name=\"scgl_scjhmx_statementPeople\" />\n" +
                   "                    </td>";

           }
           if(!data.scglWzxqjhStatementpeople==null||!data.scglWzxqjhStatementpeople==""){
               html01+="<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_statementPeople\" name=\"scgl_scjhmx_statementPeople\" value=\""+data.scglWzxqjhStatementpeople+"\"/>\n" +
                   "                    </td>";
           }
           html01+= "</tr>";


           <!--              第六行-->
           html01+= "<tr>";
           html01+= "                    <td class=\"scgl_scjhmx_secondtable_tr_td\">结单日期</td>";
          if(data.scglWzxqjhDateoforder==null||data.scglWzxqjhDateoforder==""){
              html01+= "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                  "                        <input class=\"layui-input\" type=\"text\" id=\"scgl_scjhmx_dateofOrder\" name=\"scgl_scjhmx_dateofOrder\"/>\n" +
                  "                    </td>";
          }
           if(!data.scglWzxqjhDateoforder==null||!data.scglWzxqjhDateoforder==""){
               html01+= "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_dateofOrder\" name=\"scgl_scjhmx_dateofOrder\" value=\""+data.scglWzxqjhDateoforder+"\"/>\n" +
                   "                    </td>";
           }
           html01+= "<td class=\"scgl_scjhmx_secondtable_tr_td\">最后更新人</td>";

           if(data.scglWzxqjhLastupdatepeople==null||data.scglWzxqjhLastupdatepeople==""){
               html01+=  "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_lastUpdatePeople\" name=\"scgl_scjhmx_lastUpdatePeople\"/>\n" +
                   "                    </td>";
           }
           if(!data.scglWzxqjhLastupdatepeople==null||!data.scglWzxqjhLastupdatepeople==""){
               html01+="<td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_lastUpdatePeople\" name=\"scgl_scjhmx_lastUpdatePeople\" value=\""+data.scglWzxqjhLastupdatepeople+"\"/>\n" +
                   "                    </td>";
           }
           html01+="<td class=\"scgl_scjhmx_secondtable_tr_td\">最后更新日期</td>";
           if(data.scglWzxqjhLastupdatedate==null||data.scglWzxqjhLastupdatedate==""){
               html01+= "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input class=\"layui-input\"  type=\"text\" id=\"scgl_scjhmx_lastUpdateDate\" name=\"scgl_scjhmx_lastUpdateDate\"/>\n" +
                   "                    </td>";

           }
           if(!data.scglWzxqjhLastupdatedate==null||!data.scglWzxqjhLastupdatedate=="") {
               html01 += "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\">\n" +
                   "                        <input  type=\"text\" id=\"scgl_scjhmx_lastUpdateDate\" name=\"scgl_scjhmx_lastUpdateDate\" value=\"" + data.scglWzxqjhLastupdatedate + "\"/>\n" +
                   "                    </td>";
           }
           html01+="</tr>";
            html01+="<tr>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td\">备注</td>\n" +
                "                    <td class=\"scgl_scjhmx_secondtable_tr_td01\" colspan=\"5\">";
            if(data.scglWzxqjhRemarks==null){
                html01+="<input  type=\"text\" id=\"scgl_scjhmx_remarks\"  name=\"scgl_scjhmx_remarks\" value=\"\"/>";
            } if(!data.scglWzxqjhRemarks==null){
               html01+="<input  type=\"text\" id=\"scgl_scjhmx_remarks\"  name=\"scgl_scjhmx_remarks\" value=\"" + data.scglWzxqjhRemarks + "\"/>";
           }

           html01+=  "                    </td>\n" +
                "                </tr>";
           $("#scgl_scjhmx_secondtable").append(html01);

           layui.use('laydate', function(){
               var laydate = layui.laydate;
               laydate.render({
                   elem: '#scgl_scjhmx_confirmDate' //指定元素
               });
               laydate.render({
                   elem: '#scgl_scjhmx_lastUpdateDate' //指定元素
               });
               laydate.render({
                   elem: '#scgl_scjhmx_dateofOrder' //指定元素
               });

           });
       });
    });

    var xinxi=getQueryVariable("scglWzxqjhDocumentnum");
        function getQueryVariable(name) {
           var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
           var index = window.location.href.indexOf("?");
           var query = window.location.href.substr(1).substring(index);
           var r = query.match(reg);
           if ( r != null ){
               return decodeURI(r[2]);
           }else{
               return null;
           }
       }

    //js判断是否为空:空的话就不能提交
    function verify() {
        var scgl_scjhmx_confirmPeople=$("#scgl_scjhmx_confirmPeople").val();
        var scgl_scjhmx_confirmDate=$("#scgl_scjhmx_confirmDate").val();
        if (scgl_scjhmx_confirmPeople ==null||scgl_scjhmx_confirmPeople=="" ) {
            alert('确认人不能为空');
            return false;
        }
        if (scgl_scjhmx_confirmDate ==null||scgl_scjhmx_confirmDate=="" ) {
            alert('确认日期不能为空');
            return false;
        }
    }
    </script>
    <style>
        .scgl_scjhmx_firstul {
            margin-top: 10px;
        }
        .scgl_scjhmx_firstul li {
            list-style: none;
            float: left;
            margin-left: 10px;
        }
        .scgl_scjhmx_firstdiv {

            height: 55px;
            width: 100%;
            border: 2px solid slategray;
        }
        .scgl_scjhmx_secontdiv {
            margin-top: 10px;
            width: 100%;
            height: 150px;
        }
        .scgl_scjhmx_firsttable {
            text-align: center;
            width: 100%;
            height: 100%;
            border:slategray 2px solid ;

        }
        .scgl_scjhmx_firsttable tr {
            border-bottom: 2px solid slategray;

        }
        .scgl_scjhmx_firsttable_tr_td {
            background-color: #FFFFF0;
            border-right: 2px solid slategray;
            width: 14%;
            height: 25%;

        }
        .scgl_scjhmx_firsttable_tr_td01 {
            border-right: 2px solid slategray;
            width: 14%;
            height: 25%;

        }
        .scgl_scjhmx_firsttable_tr_td01 input{
            border: none;
            width: 100%;
            height: 100%;
        }
        .scgl_scjhmx_thirdiv {
            margin-top: 10px;
            width: 100%;
            height: 300px;
        }
        .scgl_scjhmx_secondtable {
    text-align: center;
            width: 100%;
            height: 100%;
            border:slategray 2px solid ;
        }

        .scgl_scjhmx_secondtable tr{
            border-bottom: 2px solid slategray;
        }

        .scgl_scjhmx_secondtable_tr_td {
            background-color: #FFFFF0;
            border-right: 2px solid slategray;
            width: 14%;
            height: 14%;
        }
        .scgl_scjhmx_secondtable_tr_td01 input {
            border: none;
            width: 100%;
            height: 100%;
        }
        .scgl_scjhmx_secondtable_tr_td01 {
            border-right: 2px solid slategray;
            width: 14%;
            height: 14%;
        }


        .scgl_scjhmx_thirdtable tr{
            border-bottom: 2px solid slategray;
        }

    </style>
</head>
<body>
<div style="background-color: white">
    <!--页面主题-->
    <div style="height: 50px;width: 100%; font-weight: bold;text-align: center;font-size: 30px">物资需求计划详情</div>
    <!--form表单-->
    <form action="/scgl_wzcqjhupdate" onsubmit="return verify()">
        <!--操作按钮-->
        <div class="scgl_scjhmx_firstdiv">
            <ul class="scgl_scjhmx_firstul">
                <li><input class="layui-btn layui-btn-radius" type="submit" value="修改"></li>
            </ul>
        </div>
        <!--需要填写的详细信息-->
        <div class="scgl_scjhmx_secontdiv">
            <table id="scgl_scjhmx_firsttable" class="scgl_scjhmx_firsttable" cellpadding="0px" cellspacing="0px" border="2px" >
            </table>
        </div>
        <!-- /基本信息下需要填写的信息-->
        <!--     合计信息   -->
        <div class="scgl_scjhmx_thirdiv">
            <table id="scgl_scjhmx_secondtable" class="scgl_scjhmx_secondtable" cellpadding="0px" cellspacing="0px" border="2px" >
            </table>
        </div>
    </form>
    <!--/form表单-->
</div>

</body>
</html>